package org.onion.pattern.sample.order.controller;

import org.onion.pattern.sample.order.doamin.pay.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayOrderController {

    @Autowired
    private PayService payService;


    @GetMapping("pay/pay")
    public String pay() {
        return payService.pay().toString();
    }

    @GetMapping("pay/pay2")
    public String pay2() {
        return payService.pay2().toString();
    }

    @GetMapping("pay/pay4")
    public String pay4() {
        return payService.pay4().toString();
    }

    @GetMapping("pay/pay5")
    public String pay5() {
        return payService.pay5().toString();
    }

    @GetMapping("pay/refund")
    public String refund() {
        payService.refund();
        return "refund-success";
    }

    @GetMapping("pay/refund2")
    public String refundMock() {
        payService.refundMock();
        return "refund-mock";
    }

    @GetMapping("pay/cancel")
    public String cancel() {
        payService.cancel();
        return "cancel-success";
    }



}
